cmake_minimum_required(VERSION 3.10)
project(sqlite_demo C)

# 设置C++标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置 SQLite 路径
set(SQLITE3_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/sqlite_static/sqlite")
set(SQLITE3_LIBRARY "${CMAKE_SOURCE_DIR}/sqlite_static/lib/libsqlite3.a")

# 包含目录
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${SQLITE3_INCLUDE_DIR})

# 源文件
set(SOURCES
    src/main.c
    src/database.c
)

# 添加可执行文件
add_executable(sqlite_demo ${SOURCES})

# 链接静态库
target_link_libraries(sqlite_demo PRIVATE dl m pthread
    ${SQLITE3_LIBRARY}
)
